
#TODO: improve the make task by separate the giant vargrant_test.sh into small steps
# So that we can re-run it easily

help:
	@echo "To run it from scratch ( always safe and clean), make run"
	@echo "To delete any existing box, make clean"
	@echo "To restart tigase service, make restart_tigase"

# Delete any existing boxes
clean:
	vagrant destroy bcs --force

# Create a new box from scratch
up: 
	vagrant up --provision bcs

run: clean up 

# Run all the tests to make sure the box is good
testsuite:
	./vagrant_test.sh

jenkins_debug:
	./vagrant_debug.sh

# Do everything starting from fresh
all: run jenkins_test

# Create a readable task tag for jenkins
jenkins_test: testsuite jenkins_debug

# Useful for dev who frequently modify/deploy/restart the bcs code to the box
restart_tigase:
	vagrant ssh bcs -c "cd /opt/tigase && sudo make stop && sudo make start"
